//
//  smoother.hpp
//  yuzon
//
//  Created by Alvin on 2023/3/29.
//

#pragma once

#include <vector>
#include "common.hpp"

class Smoother {
public:
  explicit Smoother();
  void Process(KeypointResults &results);
  void Reset();
  
private:
  float OneEuroFilter(int64_t t, float x, int i);
  float ExponentialSmoothing(float a, float x, float x_hat_prev);
  float SmoothingFactor(float t_e, float fc);
  
  // 参数
  float fc_min_;
  float b_;
  float fc_d_;
  // 前值
  int64_t t_prev_;
  std::vector<float> x_hat_prev_;
  std::vector<float> dx_hat_prev_;
};
